Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop dependency on inflect (+typeguard&typing_extensions) #16

Closed
wants to merge 1 commit into from

Conversation

Avasam
Copy link
Contributor

@Avasam Avasam commented Jul 22, 2024

It seems overkill to pull in inflect and its dependencies just for that one function. Especially for such a specific and simple single use case.
This should also allows removing all of the following from setuptools vendored dependencies:

  • inflect
  • typeguard
  • typing_extensions

Relates to:

@Avasam Avasam changed the title Drop dependency on inflect Drop dependency on inflect (+typeguard&typing_extensions) Jul 23, 2024
@jaraco
Copy link
Owner

jaraco commented Jul 26, 2024

For the same reasons I declined #15 (essentially, I don't want to go down the path of re-implementing behavior), I plan to decline this one as well.

This concern, however, is more nuanced. I am interested in reducing the number of unnecessary dependencies (where necessary means it's used for essential behavior). In the case of the show-newlines script, that's more of a utility function, and I doubt anyone but me has ever used it (although maybe so because I'm fairly sure I've used it to demonstrate issues so maybe others replicated my findings by using it).

I'm slightly tempted to move the dependency to an extra ([inflect] or similar) to be used only when needed by show-newlines. The main reluctance I have with such an approach is that it would require also adapting the test suite to declare that dependency.

I'd consider moving the show-newlines to another library, but it's not obvious to me what library that should be. I have learned not to create "utils" or "kitchen sink" libraries, as they are too indistinct to present a meaningful purpose.

I wonder if there's another, better arrangement of libraries that would be less complicated.

Then again, I don't want to set the precedent that jaraco.text can't use inflect when appropriate. I'd like to use inflect rather than hand-code each and every inflection across every project. And I'd like for setuptools or any other project to be able to adopt the best available implementation of any behavior that's needed.

@jaraco
Copy link
Owner

jaraco commented Jul 26, 2024

In 1637bf4, I've moved the dependency to an extra, and released jaraco.text 4.0.

@jaraco jaraco closed this Jul 26, 2024
@Avasam
Copy link
Contributor Author

Avasam commented Jul 26, 2024

Thanks, 1637bf4 does achieve the same goal I wanted of not having to rely on runtime typing_extensions in setuptools if possible (and reducing a chain of dependencies). So I'm fine with your solution.

@Avasam Avasam deleted the Drop-dependency-on-inflect branch July 26, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants